<!DOCTYPE html>
	<head>
		<title>模拟微信点击图片放大效果</title>
		<meta charset="UTF-8"/>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<style type="text/css">
			.remark{
				font-size: 26px;
				color: red;
				font-weight: bold;
				display: none;
			}
			#imgBox img{
				display: block;
				width: 80%;
				margin: 30px auto;
			}
			#fullPage{
				display: none;
				background: black;
				position: fixed;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				z-index: 19930428;
			}
			#fullPage img{
				display: block;
				width: 100%;
			}
			#canvas{
				width: 100%;
				height: 100%;
				background: none;
				display: block;
			}
		</style>
	</head>
	<body>
		<div class="remark">提示：该效果仅支持移动端</div>
		<div id="imgBox">
			<img id="img" src="img/t1.png"/>
			<img id="img2" src="img/t2.png">
			<img id="img3" src="img/t3.png">
		</div>
		<div id="fullPage">
			<canvas id="canvas"></canvas>
		</div>
		
		<script src="index.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//使用方法
			var wxScale=new WxScale({
				fullPage:document.querySelector("#fullPage"),
				canvas:document.querySelector("#canvas")
			});
			
			var imgBox=document.querySelectorAll("#imgBox img");
			for(var i=0; i<imgBox.length; i++){
				imgBox[i].onclick=function(e){
					wxScale.start(this);   //这里的this指向需要放大的这张图片
				}
			}
		</script>
	</body>
</html>